package polymorphism;

/**
 * Created by admin on 2016-11-17.
 */
class Student extends Person{



    private String school;

    private String studentNo;


    Student(){
        super();
    }

    Student(String name,String sex,int age,String nationality,String school,String studentNo){
        super(name,sex,age,nationality);

        this.school=school;

        this.studentNo=studentNo;
    }

    public void work(){
        System.out.println(getName()+"'s work is study");
    }

    public String getSchool() {
        return school;
    }

    public Student setSchool(String school) {
        this.school = school;
        return this;
    }

    public String getStudentNo() {
        return studentNo;
    }

    public Student setStudentNo(String studentNo) {
        this.studentNo = studentNo;
        return this;
    }

    public String toString(){
        return super.toString()+" Student school:"+school+" studentNo:"+studentNo;
    }
}